<template>
	<view>
		<!-- 加了fixed -->
		<view class="page_header">
			<view class="status-bar"></view>
			<view class="navtop">
				<image @click="back" src="/static/index/Back_icon.png" mode="widthFix" class="back_icon"></image>
				<text class="balance">我的接单</text>
				<!-- 右边自定义图片 -->

				<view class="more" v-show="downIcon" @click="sort" v-if="n==4">编辑</view>
				<view class="more" v-show="!downIcon" @click="sort" v-if="n==4">完成</view>
			</view>
		</view>
		<!-- 没加fixed -->
		<view class="status-bar"></view>
		<view class="" style="height:  100rpx ;">
		</view>
		<view class="online_top">
			<view class="online_top_box" v-for="(item,index) in text" :key="index" :class="{checked1:index==n}" @click="dianji(item,index)">
				{{item.title}}
			</view>
		</view>

		<!-- <view  class="" style="margin:0 auto ;width: 290rpx;height: 333rpx;">
			<image src="/static/index/xingxing.png" style="width: 290rpx;height: 333rpx;display: inline-block;" mode=""></image>
		</view> -->
		
		
		<view class="list_box" v-for="(item,index) in list" :key="index">
			<view class="list_box_center" @click="goitem(item)">
				<image :src="item.img" mode=""></image>
				<view class="list_box_center_right">
					<view class="list_box_center_top">
						<view class="list_box_center_top_left diandiandian">
							{{item.title}}
						</view>
						<image v-if="!picstyle" src="/static/prodtct/cha.png" mode="" style="width: 30rpx;height: 30rpx;"></image>
					</view>

					<view class="list_box_center_right_bottom">
						<view class="list_box_center_right_bottom_price">
							￥{{item.price}}
						</view>
						<view class="" style="display: flex;font-size: 26rpx;align-items: center;color: #8E8E8E;" v-if="item.iselet==2||item.iselet==4">
							<image src="/static/dating/number.png" style="width: 30rpx;height: 20rpx;" mode=""></image><text>编号：202003200001</text>
						</view>


						<view class="" style="display: flex;" v-if="item.iselet==1">
							<view class="list_box_center_right_bottom_capzuo" @click="gotijiao">
								提交任务
							</view>
							<view class="list_box_center_right_bottom_capzuo" @click.stop="closequxiao">
								取消任务
							</view>
						</view>
						<view class="" style="display: flex;" v-if="item.iselet==3">
							<view class="list_box_center_right_bottom_capzuo" @click.stop="gotask_details">
								重新领取
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="list_box_top">
				<view class="list_box_top_left" v-if="item.iselet==1" style="font-size: 28rpx;color: #8E8E8E;">
					<image src="/static/user2/time.png" style="width: 30rpx;height: 30rpx;" mode=""></image>请在&nbsp;<uni-countdown
					 :show-day="false" :hour="12" :minute="12" :second="12"></uni-countdown> &nbsp;内完成提交
				</view>

				<view class="list_box_top_left" v-if="item.iselet==2" style="font-size: 28rpx;color: #8E8E8E;">
					<image src="/static/prodtct/gantanhao.png" style="width: 30rpx;height: 30rpx;" mode=""></image>凭证将在24小时内发放到账
				</view>
				<view class="list_box_top_left" v-if="item.iselet==3" style="font-size: 28rpx;color: #8E8E8E;">
					<image src="/static/prodtct/gantanhao.png" style="width: 30rpx;height: 30rpx;" mode=""></image>原因：超时未提交
				</view>
				<view class="list_box_top_left" v-if="item.iselet==4" style="font-size: 28rpx;color: #8E8E8E;">
					<image src="/static/user2/time.png" style="width: 30rpx;height: 30rpx;" mode=""></image>
					到账时间：2020-03-25 09:30
				</view>
				<view class="list_box_top_right" style="color: #F0C102;" v-if="item.iselet==2">
					审核中
				</view>
				<view class="list_box_top_right tijiao" v-if="item.iselet==1">
					待提交
				</view>
				<view class="list_box_top_right" style="color: #8E8E8E;" v-if="item.iselet==3">
					任务取消
				</view>
				<view class="list_box_top_right" style="color: #2AC144;" v-if="item.iselet==4">
					通过审核
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import uniCountdown from '@/components/uni-countdown/uni-countdown.vue'
	export default {
		components: {
			uniCountdown,
		},
		data() {
			return {
				downIcon: true,
				picstyle: true,
				n: 0,
				text: [{
						title: '全部',
						id: "1"
					},
					{
						title: '进行中',
						id: "1"
					},
					{
						title: '审核中',
						id: "1"
					},
					{
						title: '不合格',
						id: "1"
					},
					{
						title: '已完成',
						id: "1"
					},
				],
				list: [{
						img: 'http://t8.baidu.com/it/u=1484500186,1503043093&fm=79&app=86&size=h300&n=0&g=4n&f=jpeg?sec=1590043349&t=ab2af331e765a97e44b4aee44524ce0b',
						title: 'Gucci印花兜帽卫衣',
						price: '108.84',
						number: '1',
						iselet: 1
					},
					{
						img: 'http://t8.baidu.com/it/u=1484500186,1503043093&fm=79&app=86&size=h300&n=0&g=4n&f=jpeg?sec=1590043349&t=ab2af331e765a97e44b4aee44524ce0b',
						title: 'Gucci印花兜帽卫衣',
						price: '108.84',
						number: '1',
						iselet: 2
					},
					{
						img: 'http://t8.baidu.com/it/u=1484500186,1503043093&fm=79&app=86&size=h300&n=0&g=4n&f=jpeg?sec=1590043349&t=ab2af331e765a97e44b4aee44524ce0b',
						title: 'Gucci印花兜帽卫衣',
						price: '108.84',
						number: '1',
						iselet: 3
					},
					{
						img: 'http://t8.baidu.com/it/u=1484500186,1503043093&fm=79&app=86&size=h300&n=0&g=4n&f=jpeg?sec=1590043349&t=ab2af331e765a97e44b4aee44524ce0b',
						title: 'Gucci印花兜帽卫衣',
						price: '108.84',
						number: '1',
						iselet: 4
					},
				]

			}
		},
		methods: {
			// list数据
			goitem(item) {
				console.log(item)
				if (item.iselet == 3) {
					uni.navigateTo({
						url: "Cancellation_task"
					})
				} else if (item.iselet == 2) {
					uni.navigateTo({
						url: "shengheDingdan"
					})
				} else if (item.iselet == 4) {
					uni.navigateTo({
						url: "wanchenDingdan"
					})
				} else if (item.iselet == 1) {
					this.gotijiao()
				}
			},
			// 取消任务
			closequxiao() {
				uni.showModal({
					title: '提示？',
					content: '确定取消该任务吗',
					success(res) {
						if (res.confirm) {
							uni.showToast({
								title: "删除成功！",
							})
						} else if (res.cancel) {

						}
					}

				})
			},
			// 提交任务
			gotijiao() {
				uni.navigateTo({
					url: "../../index/task_details/Receive_task"
				})
			},
			// 重新领取任务
			gotask_details() {
				uni.navigateTo({
					url: "../../index/task_details/task_details"
				})
			},
			gopingjia() {
				uni.navigateTo({
					url: "comment"
				})
			},
			sort() {
				this.downIcon = !this.downIcon
				console.log(this.downIcon)
				if (this.downIcon == false) {
					this.picstyle = false
				} else {
					this.picstyle = true
				}
			},
			back() {
				uni.navigateBack({

				})
			},
			gotaskone() {

			},
			dianji(item, index) {
				this.n = index
				this.downIcon = true
				this.picstyle = true
			},
		}
	}
</script>

<style lang="less">
	.checked1 {
		font-weight: bold !important;
		border-bottom: 6rpx solid #7322D8;
		box-sizing: border-box;
		border-radius: 3rpx;
	}

	page {
		background-color: #EFEFF4;
		box-sizing: border-box;
	}

	.more {
		position: absolute;
		right: 67rpx;
		font-size: 32rpx;
		background: linear-gradient(45deg, rgba(212, 32, 238, 1) 0%, rgba(115, 34, 216, 1) 100%);
		-webkit-background-clip: text;
		color: transparent;
	}

	.online_top {
		width: 750rpx;
		height: 84rpx;
		margin-bottom: 30rpx;
		background-color: white;
		border-top: 1rpx solid #EFEFF4;
		display: flex;
		justify-content: space-between;
		padding: 0 36rpx;
		align-items: center;
		box-sizing: border-box;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: rgba(51, 51, 51, 1);

		.online_top_box {
			height: 100%;
			line-height: 84rpx;
		}
	}

	.list_box {
		width: 680rpx;
		height: 240rpx;
		background: rgba(255, 255, 255, 1);
		border-radius: 20rpx;
		margin: 0 auto 20rpx auto;
		padding: 30rpx 24rpx;
		box-sizing: border-box;

		.list_box_top {
			height: 60rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-bottom: 22rpx;
			border-top: 1rpx solid #E5E5E5;

			.list_box_top_left {
				display: flex;
				align-items: center;
				width: 500rpx;

				image {
					width: 32rpx;
					height: 29rpx;
					margin-right: 13rpx;
				}

				text {
					font-size: 30rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: rgba(51, 51, 51, 1);
				}
			}

			.list_box_top_right {
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: rgba(115, 34, 216, 1);
			}
		}

		.list_box_center {
			height: 146rpx;
			display: flex;

			image {
				width: 120rpx;
				height: 120rpx;
				border-radius: 8rpx;
				margin-right: 26rpx;
			}
		}
	}

	.list_box_center_right {
		width: 475rpx;
		display: flex;
		flex-direction: column;

		.list_box_center_top {
			display: flex;
			justify-content: space-between;

			.list_box_center_top_left {
				width: 227px;
				height: 25px;
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: rgba(51, 51, 51, 1);
			}

			.list_box_center_top_right {
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: rgba(142, 142, 142, 1);
			}
		}

		.list_box_center_right_bottom {
			display: flex;
			justify-content: space-between;
			margin-top: 20rpx;

			.list_box_center_right_bottom_price {
				font-size: 32rpx;
				font-family: FZHei-B01S;
				font-weight: 400;
				color: red;
			}

			.list_box_center_right_bottom_capzuo {
				border: 1rpx solid rgba(115, 34, 216, 1);
				border-radius: 24rpx;
				color: #7322D8;
				font-size: 24rpx;
				padding-left: 16rpx;
				padding-right: 16rpx;
				box-sizing: border-box;
				padding-top: 6rpx;
				padding-bottom: 6rpx;
				margin-top: 6rpx;
				margin-left: 10rpx;
			}

			.list_box_center_right_bottom_capzuo1 {
				border-radius: 24rpx;
				color: #7322D8;
				font-size: 24rpx;
				box-sizing: border-box;
				margin-top: 6rpx;
			}
		}
	}

	.tijiao {
		color: rgba(233, 3, 249, 1) !important;
	}
</style>
